<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue组件</title>
    <script src="https://unpkg.com/vue@next"></script>
    <!-- 
        1.子组件不接受父组件
        2.Non-prop 属性在做样式修饰和class修饰有用
        3.父组件给子组件传递参数的时候,不仅可以在v-bind里面用
     -->
</head>
<body>
    <div id="root"></div>
    <script>
        // vue的生命周期函数
        const app = Vue.createApp({
            data() {
                return {
                    
                }
            },
            template: `
            <div>
                <counter msg="hello" msg1="hello2" />
            </div>
            `
        });
        app.component('counter',{
            // props:['msg'],
            // 加了这个属性,子组件就不会继承
            // inheritAttrs:false,
            
            template: `
            <div :msg1="$attrs.msg1">counter</div>
            <div v-bind="$attrs">counter</div>
            <div>counter</div>
            `
        })
        const vm = app.mount('#root');
    </script>
</body>
</html>